-- CALC_MINIMUM_NUMBER_OF_MATERIAL

-- 获取玩家身上最少的材料id
-- items 比较数量大小的集合
return function(user, items)
    local rand = DungeonM.getRandSeed("career_base_bonus");
    local id = tonumber(items[rand % #items + 1]);
    local amount  = ItemM.getAmount(user, id);

    for _, i in pairs(items) do
        i = tonumber(i);
        if ItemM.getAmount(user, i) < amount then
            amount = ItemM.getAmount(user, i);
            id = i;
        end
    end

    -- 返回其中数量最少的编号id
    return id;
end
